<?php
class Boolean_Datatype extends DatatypeBase{
	
	var $length = 1;
	var $type 	= 'tinyint';
	
	
	
	function edit($value, $name, $extra = array()){
		$extra['type'] = 'checkbox';
		if( $value == 1 ){
			$extra['checked'] = true;
		}
		$value = 1;
		return parent::edit($value, $name, $extra);
	}
	
	function prepareDatatypeVal($value){
		if( empty( $value ) ){
			$value = 0;
		} 
		return $value;
	}
	
	
}	


?>
